package com.dnfm.game.equip.service;

public class PanelService {

    /**
     * 计算面板攻击
     *
     * @param panelPower 面板力量
     * @param baseAct    基础攻击
     * @param actRate    攻击增加倍率，如1.15
     * @return 面板攻击
     */
    public static Double getPanelAct(Double panelPower, Double baseAct, Double actRate) {
        if (panelPower == null || baseAct == null || actRate == null) {
            throw new RuntimeException("can't be null! -->" + panelPower + " " + baseAct + " " + actRate);
        }
        panelPower = (double) panelPower.intValue();
        baseAct = (double) baseAct.intValue();
        return baseAct * (panelPower / 250 + 1) * (1 + actRate);
    }


    /**
     * 计算面板力量
     */
    public static Double getPanelPower(Double basePower, Double powerRate) {
        if (basePower == null || powerRate == null) {
            throw new RuntimeException("can't be null! -->" + basePower + " " + powerRate);
        }
        return basePower * (1 + powerRate);
    }


}
